<!DOCTYPE html>

<html lang="en">
  <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>过滤与清理（Filtering and Sanitizing） &mdash; Phalcon 2.0.0 文档</title>
    <meta name="keywords" content="php, phalcon, phalcon php, php framework, faster php framework"><link rel="stylesheet" type="text/css" href="../_static/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="http://static.phalconphp.com/css/phalcon.min.css" />
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400' rel='stylesheet' type='text/css'>
    <link href="http://fonts.googleapis.com/css?family=Merriweather:400,700" rel="stylesheet" type="text/css" />
    <!--
    EUROPE <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=latin-ext' rel='stylesheet' type='text/css'>
    GREEK <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=greek-ext' rel='stylesheet' type='text/css'>
    RUSSIA <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=cyrillic-ext,latin' rel='stylesheet' type='text/css'>
    -->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/docs.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.0.0',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>

    <script src="../_static/jquery.min.js"></script>
    <script type="text/javascript" src="../_static/docs.js"></script>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="top" title="Phalcon 2.0.0 文档" href="../index.html" />
    <link rel="next" title="上下文编码（Contextual Escaping）" href="escaper.html" />
    <link rel="prev" title="使用 Session 存储数据（Storing data in Session）" href="session.html" /> 
  </head>
  <body>

<header class="page-header">
    <nav class="navbar" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-menu-container">
                    <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
                </button>
                <a class="navbar-brand phalcon-logo" href="/"><span itemprop="name" class="sr-only">Phalcon PHP</span></a>
            </div>

            <div class="collapse navbar-collapse navbar-right" id="main-menu-container">
                <ul class="nav navbar-nav main-menu">
                  <li class="first"><a href="http://phalconphp.com/en/download" class="header-nav-link">Download</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/index.html" class="header-nav-link" target="_blank">Documentation</a></li>
                  <li><a href="http://forum.phalconphp.com/" class="header-nav-link" target="_blank">Forum</a></li>
                  <li><a href="http://blog.phalconphp.com/" class="header-nav-link" target="_blank">Blog</a></li>
                  <li><a href="http://phalconphp.com/en/about">About</a></li>
                </ul>
            </div>
        </div>
    </nav>
  </header>

<div class="heading">
    <div class="container">
        <div class="row">
            <h2>Documentation</h2>
        </div>
    </div>
</div>
    <!--<div class="header-line">
      <div class="size-wrap">
        <div class="header-line-title title-white">Documentation</div>
      </div>
    </div>-->
    <div class="related">
      <ul>
        <li class="right" >
          <a href="../genindex.html" title="总目录"
             accesskey="I">索引</a></li>
        <li class="right" >
          <a href="escaper.html" title="上下文编码（Contextual Escaping）"
             accesskey="N">下一页</a> |</li>
        <li class="right" >
          <a href="session.html" title="使用 Session 存储数据（Storing data in Session）"
             accesskey="P">上一页</a> |</li>
        <li><a href="http://phalconphp.com">Home</a> &raquo;</li>
        <li><a href="../index.html">Phalcon 2.0.0 文档</a> &raquo;</li> 
      </ul>
    </div>  

      <table width="100%" align="center" cellpadding="0" cellspacing="0">
        <tr>
      <td class="primary-box" width="25%" valign="top">
            <div>
            <div id="searchbox" style="">
                <!--<form class="search" action="http://readthedocs.org/search/project/" method="get">
                  <input type="search" name="q" size="25" placeholder="Search">
                  <input type="submit" value="Go">
                  <input type="hidden" name="selected_facets" value="project:">
                </form>-->
                <div style="width:200px;padding:10px">
                  <gcse:searchbox-only></gcse:searchbox-only>
                </div>
            </div>
            </div>
            <div style="padding:5px;padding-left:10px">
              <div id="carbonads-container">
                <div class="carbonad"><div id="azcarbon"></div>
                <script type="text/javascript">var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = "http://engine.carbonads.com/z/56496/azcarbon_2_1_0_VERT"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script>
                </div></div>
            </div>
            <h3><a href="../index.html">內容目录</a></h3>
            <ul>
<li><a class="reference internal" href="#">过滤与清理（Filtering and Sanitizing）</a><ul>
<li><a class="reference internal" href="#sanitizing-data">清理数据（Sanitizing data）</a></li>
<li><a class="reference internal" href="#sanitizing-from-controllers">在控制器中使用清理（Sanitizing from Controllers）</a></li>
<li><a class="reference internal" href="#filtering-action-parameters">过滤动作参数（Filtering Action Parameters）</a></li>
<li><a class="reference internal" href="#filtering-data">过滤数据（Filtering data）</a></li>
<li><a class="reference internal" href="#types-of-built-in-filters">内置过滤器类型（Types of Built-in Filters）</a></li>
<li><a class="reference internal" href="#creating-your-own-filters">创建过滤器（Creating your own Filters）</a></li>
<li><a class="reference internal" href="#complex-sanitizing-and-filtering">复杂的过滤与清理（Complex Sanitizing and Filtering）</a></li>
<li><a class="reference internal" href="#implementing-your-own-filter">自定义过滤器（Implementing your own Filter）</a></li>
</ul>
</li>
</ul>

            <h4>上一个主题</h4>
            <p class="topless"><a href="session.html" title="上一章">&lt; 使用 Session 存储数据（Storing data in Session）</a></p>
            <h4>下一个主题</h4>
            <p class="topless"><a href="escaper.html" title="下一章">上下文编码（Contextual Escaping） &gt;</a></p>
            <h3>本页</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/reference/filter.txt" rel="nofollow">显示源代码</a></li>
            </ul>
        </td>
          <td class="second-box" valign="top">
            <div class="document">
                <div class="documentwrapper">
                  <div class="bodywrapper">
                    <div class="body" >
                      
  <div class="section" id="filtering-and-sanitizing">
<h1>过滤与清理（Filtering and Sanitizing）<a class="headerlink" href="#filtering-and-sanitizing" title="永久链接至标题">¶</a></h1>
<p>清理用户输入是软件开发中很重要的一个环节。信任或者忽略对用户输入数据作清理可能会导致
对应用内容（主要是用户数据），甚至你应用所处在的服务器的非法访问。</p>
<div class="figure align-center">
<img alt="../_images/sql.png" src="../_images/sql.png" />
</div>
<p><a class="reference external" href="http://xkcd.com/327/">Full image (from xkcd)</a></p>
<p>此 <a class="reference internal" href="../api/Phalcon_Filter.html"><em>Phalcon\Filter</em></a> 组件提供了一系列通用可用的过滤器和数据清理助手。它提供了围绕于PHP过滤扩展的面向对象包装。</p>
<div class="section" id="sanitizing-data">
<h2>清理数据（Sanitizing data）<a class="headerlink" href="#sanitizing-data" title="永久链接至标题">¶</a></h2>
<p>清理是指从一个值中移除特定字符的过程，此过程对用户和应用不是必须，也不是他们想得到的。
通过清理输入，我们确保了应用的完整性和正确性。</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Filter</span><span class="p">;</span>

<span class="nv">$filter</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Filter</span><span class="p">();</span>

<span class="c1">// 返回 &quot;someone@example.com&quot;</span>
<span class="nv">$filter</span><span class="o">-&gt;</span><span class="na">sanitize</span><span class="p">(</span><span class="s2">&quot;some(one)@exa\mple.com&quot;</span><span class="p">,</span> <span class="s2">&quot;email&quot;</span><span class="p">);</span>

<span class="c1">// 返回 &quot;hello&quot;</span>
<span class="nv">$filter</span><span class="o">-&gt;</span><span class="na">sanitize</span><span class="p">(</span><span class="s2">&quot;hello&lt;&lt;&quot;</span><span class="p">,</span> <span class="s2">&quot;string&quot;</span><span class="p">);</span>

<span class="c1">// 返回 &quot;100019&quot;</span>
<span class="nv">$filter</span><span class="o">-&gt;</span><span class="na">sanitize</span><span class="p">(</span><span class="s2">&quot;!100a019&quot;</span><span class="p">,</span> <span class="s2">&quot;int&quot;</span><span class="p">);</span>

<span class="c1">// 返回 &quot;100019.01&quot;</span>
<span class="nv">$filter</span><span class="o">-&gt;</span><span class="na">sanitize</span><span class="p">(</span><span class="s2">&quot;!100a019.01a&quot;</span><span class="p">,</span> <span class="s2">&quot;float&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="sanitizing-from-controllers">
<h2>在控制器中使用清理（Sanitizing from Controllers）<a class="headerlink" href="#sanitizing-from-controllers" title="永久链接至标题">¶</a></h2>
<p>当接收到GET或POST的数据时（通过请求对象），你可以在控制器中访问一个 <a class="reference internal" href="../api/Phalcon_Filter.html"><em>Phalcon\Filter</em></a> 对象。
第一个参数是等待获得变量的名字，第二个参数是将应用在此变量的过滤器。</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Mvc\Controller</span><span class="p">;</span>

<span class="k">class</span> <span class="nc">ProductsController</span> <span class="k">extends</span> <span class="nx">Controller</span>
<span class="p">{</span>

    <span class="k">public</span> <span class="k">function</span> <span class="nf">indexAction</span><span class="p">()</span>
    <span class="p">{</span>

    <span class="p">}</span>

    <span class="k">public</span> <span class="k">function</span> <span class="nf">saveAction</span><span class="p">()</span>
    <span class="p">{</span>

        <span class="c1">// 从输入中清理price</span>
        <span class="nv">$price</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">request</span><span class="o">-&gt;</span><span class="na">getPost</span><span class="p">(</span><span class="s2">&quot;price&quot;</span><span class="p">,</span> <span class="s2">&quot;double&quot;</span><span class="p">);</span>

        <span class="c1">// 从输入中清理email</span>
        <span class="nv">$email</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">request</span><span class="o">-&gt;</span><span class="na">getPost</span><span class="p">(</span><span class="s2">&quot;customerEmail&quot;</span><span class="p">,</span> <span class="s2">&quot;email&quot;</span><span class="p">);</span>

    <span class="p">}</span>

<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="filtering-action-parameters">
<h2>过滤动作参数（Filtering Action Parameters）<a class="headerlink" href="#filtering-action-parameters" title="永久链接至标题">¶</a></h2>
<p>接下来的示例演示了在一个控制器的动作中如何清理动作的参数：</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Mvc\Controller</span><span class="p">;</span>

<span class="k">class</span> <span class="nc">ProductsController</span> <span class="k">extends</span> <span class="nx">Controller</span>
<span class="p">{</span>

    <span class="k">public</span> <span class="k">function</span> <span class="nf">indexAction</span><span class="p">()</span>
    <span class="p">{</span>

    <span class="p">}</span>

    <span class="k">public</span> <span class="k">function</span> <span class="nf">showAction</span><span class="p">(</span><span class="nv">$productId</span><span class="p">)</span>
    <span class="p">{</span>
        <span class="nv">$productId</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">filter</span><span class="o">-&gt;</span><span class="na">sanitize</span><span class="p">(</span><span class="nv">$productId</span><span class="p">,</span> <span class="s2">&quot;int&quot;</span><span class="p">);</span>
    <span class="p">}</span>

<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="filtering-data">
<h2>过滤数据（Filtering data）<a class="headerlink" href="#filtering-data" title="永久链接至标题">¶</a></h2>
<p>此外， <a class="reference internal" href="../api/Phalcon_Filter.html"><em>Phalcon\Filter</em></a> 也提供了可以进行删除或者修改输入数据以满足我们需要的格式的过滤器。</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Filter</span><span class="p">;</span>

<span class="nv">$filter</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Filter</span><span class="p">();</span>

<span class="c1">// 返回 &quot;Hello&quot;</span>
<span class="nv">$filter</span><span class="o">-&gt;</span><span class="na">sanitize</span><span class="p">(</span><span class="s2">&quot;&lt;h1&gt;Hello&lt;/h1&gt;&quot;</span><span class="p">,</span> <span class="s2">&quot;striptags&quot;</span><span class="p">);</span>

<span class="c1">// 返回 &quot;Hello&quot;</span>
<span class="nv">$filter</span><span class="o">-&gt;</span><span class="na">sanitize</span><span class="p">(</span><span class="s2">&quot;  Hello   &quot;</span><span class="p">,</span> <span class="s2">&quot;trim&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="types-of-built-in-filters">
<h2>内置过滤器类型（Types of Built-in Filters）<a class="headerlink" href="#types-of-built-in-filters" title="永久链接至标题">¶</a></h2>
<p>以下是该容器提供的内置过滤器：</p>
<table border="1" class="docutils">
<colgroup>
<col width="13%" />
<col width="87%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">名称</th>
<th class="head">描述</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>string</td>
<td>带标签</td>
</tr>
<tr class="row-odd"><td>email</td>
<td>删掉除字母、数字和 !#$%&amp;*+-/=?^_`{|}~&#64;.[] 外的全部字符</td>
</tr>
<tr class="row-even"><td>int</td>
<td>删掉除R数字、加号、减号外的全部字符</td>
</tr>
<tr class="row-odd"><td>float</td>
<td>删掉除数字、点号和加号、减号外的全部字符</td>
</tr>
<tr class="row-even"><td>alphanum</td>
<td>删掉除[a-zA-Z0-9]外的全部字符</td>
</tr>
<tr class="row-odd"><td>striptags</td>
<td>调用 <a class="reference external" href="http://www.php.net/manual/en/function.strip-tags.php">strip_tags</a> 方法</td>
</tr>
<tr class="row-even"><td>trim</td>
<td>调用 <a class="reference external" href="http://www.php.net/manual/en/function.trim.php">trim</a>  方法</td>
</tr>
<tr class="row-odd"><td>lower</td>
<td>调用 <a class="reference external" href="http://www.php.net/manual/en/function.strtolower.php">strtolower</a> 方法</td>
</tr>
<tr class="row-even"><td>upper</td>
<td>调用 <a class="reference external" href="http://www.php.net/manual/en/function.strtoupper.php">strtoupper</a>  方法</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="creating-your-own-filters">
<h2>创建过滤器（Creating your own Filters）<a class="headerlink" href="#creating-your-own-filters" title="永久链接至标题">¶</a></h2>
<p>你可以将你自己的过滤器添加到 <a class="reference internal" href="../api/Phalcon_Filter.html"><em>Phalcon\Filter</em></a> 。过滤器的方法可以是匿名函数：</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Filter</span><span class="p">;</span>

<span class="nv">$filter</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Filter</span><span class="p">();</span>

<span class="c1">// 使用匿名函数</span>
<span class="nv">$filter</span><span class="o">-&gt;</span><span class="na">add</span><span class="p">(</span><span class="s1">&#39;md5&#39;</span><span class="p">,</span> <span class="k">function</span><span class="p">(</span><span class="nv">$value</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="nb">preg_replace</span><span class="p">(</span><span class="s1">&#39;/[^0-9a-f]/&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="nv">$value</span><span class="p">);</span>
<span class="p">});</span>

<span class="c1">// 利用md5过滤器清理</span>
<span class="nv">$filtered</span> <span class="o">=</span> <span class="nv">$filter</span><span class="o">-&gt;</span><span class="na">sanitize</span><span class="p">(</span><span class="nv">$possibleMd5</span><span class="p">,</span> <span class="s2">&quot;md5&quot;</span><span class="p">);</span>
</pre></div>
</div>
<p>或者，如果你愿意，你可以在类中实现过滤器：</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Filter</span><span class="p">;</span>

<span class="k">class</span> <span class="nc">IPv4Filter</span>
<span class="p">{</span>

    <span class="k">public</span> <span class="k">function</span> <span class="nf">filter</span><span class="p">(</span><span class="nv">$value</span><span class="p">)</span>
    <span class="p">{</span>
        <span class="k">return</span> <span class="nb">filter_var</span><span class="p">(</span><span class="nv">$value</span><span class="p">,</span> <span class="nx">FILTER_VALIDATE_IP</span><span class="p">,</span> <span class="nx">FILTER_FLAG_IPV4</span><span class="p">);</span>
    <span class="p">}</span>

<span class="p">}</span>

<span class="nv">$filter</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Filter</span><span class="p">();</span>

<span class="c1">// 使用对象</span>
<span class="nv">$filter</span><span class="o">-&gt;</span><span class="na">add</span><span class="p">(</span><span class="s1">&#39;ipv4&#39;</span><span class="p">,</span> <span class="k">new</span> <span class="nx">IPv4Filter</span><span class="p">());</span>

<span class="c1">// 利用&quot;ipv4&quot;过滤器清理</span>
<span class="nv">$filteredIp</span> <span class="o">=</span> <span class="nv">$filter</span><span class="o">-&gt;</span><span class="na">sanitize</span><span class="p">(</span><span class="s2">&quot;127.0.0.1&quot;</span><span class="p">,</span> <span class="s2">&quot;ipv4&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="complex-sanitizing-and-filtering">
<h2>复杂的过滤与清理（Complex Sanitizing and Filtering）<a class="headerlink" href="#complex-sanitizing-and-filtering" title="永久链接至标题">¶</a></h2>
<p>你可以使用PHP本身提供的优秀过滤器扩展。请查看对应的文档： <a class="reference external" href="http://www.php.net/manual/en/book.filter.php">PHP文档上的数据过滤器</a></p>
</div>
<div class="section" id="implementing-your-own-filter">
<h2>自定义过滤器（Implementing your own Filter）<a class="headerlink" href="#implementing-your-own-filter" title="永久链接至标题">¶</a></h2>
<p>如需创建你自己的过滤器并代替Phalcon提供的过滤器，你需要实现 <a class="reference internal" href="../api/Phalcon_FilterInterface.html"><em>Phalcon\FilterInterface</em></a> 接口。</p>
</div>
</div>


                    </div>
                  </div>
                </div>
            </div>
          </td>
        </tr>
      </table>
    <div class="related">
      <ul>
        <li class="right" >
          <a href="../genindex.html" title="总目录"
             >索引</a></li>
        <li class="right" >
          <a href="escaper.html" title="上下文编码（Contextual Escaping）"
             >下一页</a> |</li>
        <li class="right" >
          <a href="session.html" title="使用 Session 存储数据（Storing data in Session）"
             >上一页</a> |</li> 
      </ul>
    </div>

      <div class="prefooter">
  <div class="container">
      <div class="row">
          <div class="col-sm-3 text-right">
              <span>Follow along:</span>
          </div>
          <div class="col-sm-6 text-center">
              <a href="https://twitter.com/phalconphp" alt="Twitter" class="btn-social btn-social-twitter"><i class="icon-twitter"></i></a>
              <a href="https://www.facebook.com/pages/Phalcon-Framework/134230726685897" alt="Facebook" class="btn-social btn-social-facebook"><i class="icon-facebook"></i></a>
              <a href="https://plus.google.com/102376109340560896457" alt="Google+" class="btn-social btn-social-googleplus"><i class="icon-googleplus"></i></a>
              <a href="https://github.com/phalcon/cphalcon" alt="Github" class="btn-social btn-social-github"><i class="icon-github"></i></a>
          </div>
          <div class="col-sm-3">
          </div>
      </div>
  </div>

</div>
<footer class="footer">
  <div class="container">
      <div class="row">
          <div class="col-xs-4 col-sm-3">
              <h4>Download</h4>
              <ul>
                  <li><a href="http://phalconphp.com/download">Installing Phalcon</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/index.html" class="header-nav-link" target="_blank">Documentation</a></li>
                  <li><a href="http://api.phalconphp.com">API</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/reference/tutorial.html">Tutorial</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/reference/tutorial.html#sample-applications">Sample Applications</a></li>
              </ul>
          </div>
          <div class="col-xs-4 col-sm-3">
              <h4>Community</h4>
              <ul>
                  <li><a href="http://forum.phalconphp.com/" class="header-nav-link" target="_blank">Forum</a></li>
                  <li><a href="https://github.com/phalcon/cphalcon">GitHub</a></li>
                  <li><a href="https://github.com/phalcon/cphalcon/issues">Issue Tracker</a></li>
                  <li><a href="http://stackoverflow.com/questions/tagged/phalcon">Stack Overflow</a></li>
                  <li><a href="http://phalconphp.com/en/testimonials">Testimonials</a></li>
                  <li><a href="http://builtwith.phalconphp.com/">Built with Phalcon</a></li>
                  <li><a href="http://store.phalconphp.com/">Store</a></li>
              </ul>
          </div>
          <div class="col-xs-4 col-sm-2">
              <h4>About</h4>
              <ul>
                  <li><a class="link-black" href="http://blog.phalconphp.com/">Blog</a></li>
                  <li><a href="http://phalconphp.com/en/about">About</a></li>
                  <li><a href="http://phalconphp.com/en/team">Team</a></li>
                  <li><a href="http://phalconphp.com/en/roadmap">Roadmap</a></li>
                  <li><a href="http://phalconphp.com/en/donate">Donate</a></li>
                  <li><a href="http://phalconphp.com/en/consulting">Consulting</a></li>
                  <li><a href="http://phalconphp.com/en/hosting">Hosting</a></li>
              </ul>
          </div>
          <div id="license-spaccer" class="visible-xs"></div>
          <div id="license-wrapper" class="col-xs-12 col-sm-4">
              <p class="license">

                  Found a typo or an error? Want to improve this document? The documentation sources are available on <a href="http://github.com/phalcon/docs">Github</a><br>
                  Need support or have questions? Check our <a href="http://forum.phalconphp.com">Forum</a><br>
                  <br>

                  Phalcon Framework is released under the <a href="https://github.com/phalcon/cphalcon/blob/master/docs/LICENSE.md">new BSD license</a>.<br>
                  Except where otherwise noted, content on this site is licensed under the
                    <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 License.</a>

                <div class="design">
                  <span>Designed by:</span>

                  <a href="http://www.fog-city.net/" class="fogcity" target="_blank" title="Fog City Software"><span>Fog City Software</span></a>
              </div>
          </div>
      </div>
  </div>
</footer>

    </div>
    <script type="text/javascript">
    $(window).on("load", function(){
      var cx = '009733439235723428699:lh9ltjgvdz8';
      var gcse = document.createElement('script');
      gcse.type = 'text/javascript';
      gcse.async = true;
      gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx;
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(gcse, s);
    });
    </script>

  </body>
</html>